package com.banyuan.lesson.集合.Colleection.Set.HashMap;

import com.banyuan.lesson.集合.Colleection.list.Student;

import java.util.HashMap;
import java.util.Map;

public class HashMapDemo2 {
    public static void main(String[] args) {
        Map<String, Student> stuMap = new HashMap<>();
        stuMap.put("aaa", new Student("aaa",12,'m'));
        stuMap.put("bbb", new Student("bbb",12,'m'));
        stuMap.put("ccc", new Student("ccc",12,'m'));
        stuMap.put("ddd", new Student("ddd",12,'m'));
        stuMap.put("eee", new Student("eee",12,'m'));
        stuMap.put("ccc", new Student("111",12,'m'));

        //如果出现两个相同的key，那么后出现的key映射的value会覆盖之前的；
        System.out.println(stuMap.get("ccc"));
    }
}
